********************************************************************************
* Project: Measuring party system nationalisation
*  Author: Kazuma Mizukoshi
*    Date: 19 August 2020
********************************************************************************

********************************************************************************
* TASK-1: Install Clarify
* TASK-2: Estimate relative nationalisation - Brazil
* TASK-3: Estimate relative nationalisation - Ecuador
********************************************************************************

********************************************************************************
* TASK-1: Install Clarify
********************************************************************************
update all, force
net from https://gking.harvard.edu/clarify
net install clarify

********************************************************************************
* TASK-2: Estimate relative nationalisation - Brazil
* TASK-2a: 1990 - 1994
* TASK-2b: 1994 - 1998
* TASK-2c: 1998 - 2002
* TASK-2d: 2002 - 2006
* TASK-2e: 2006 - 2010
* TASK-2f: 2010 - 2014
********************************************************************************

* TASK-2a: 1990 - 1994 (Baseline party = PMDB)
sureg /// 
          (PT_ln94 PT_ln90 DEM_ln90 PSDB_ln90 PDS_ln90 Other_ln90) ///
		  (DEM_ln94 PT_ln90 DEM_ln90 PSDB_ln90 PDS_ln90 Other_ln90) ///
		  (PSDB_ln94 PT_ln90 DEM_ln90 PSDB_ln90 PDS_ln90 Other_ln90) ///
		  (PP_ln94 PT_ln90 DEM_ln90 PSDB_ln90 PDS_ln90 Other_ln90) ///
		  (Other_ln94 PT_ln90 DEM_ln90 PSDB_ln90 PDS_ln90 Other_ln90) ///
		  [w = VV94], small dfk isure
		  
estsimp sureg /// 
          (PT_ln94 PT_ln90 DEM_ln90 PSDB_ln90 PDS_ln90 Other_ln90) ///
		  (DEM_ln94 PT_ln90 DEM_ln90 PSDB_ln90 PDS_ln90 Other_ln90) ///
		  (PSDB_ln94 PT_ln90 DEM_ln90 PSDB_ln90 PDS_ln90 Other_ln90) ///
		  (PP_ln94 PT_ln90 DEM_ln90 PSDB_ln90 PDS_ln90 Other_ln90) ///
		  (Other_ln94 PT_ln90 DEM_ln90 PSDB_ln90 PDS_ln90 Other_ln90) ///
		  [w = VV94], small dfk isure sims(1000) antisim
		  
setx mean [w=VV94] 

simqi, pv genpv(pv_pt_ln94 pv_dem_ln94 pv_psdb_ln94 pv_pp_ln94 pv_other_ln94) tfunc(logiti) 
simqi, ev genev(ev_pt_ln94 ev_dem_ln94 ev_psdb_ln94 ev_pp_ln94 ev_other_ln94) tfunc(logiti) 

generate pv_pmdb_ln94 = 1 - (pv_pt_ln94 + pv_dem_ln94 + pv_psdb_ln94 + pv_pp_ln94 + pv_other_ln94) 
generate ev_pmdb_ln94 = 1 - (ev_pt_ln94 + ev_dem_ln94 + ev_psdb_ln94 + ev_pp_ln94 + ev_other_ln94) 

summarize pv_pmdb_ln94 ev_pmdb_ln94
summarize PT_90 PT_94 DEM_90 DEM_94 PSDB_90 PSDB_94 PP_90 PP_94 PMDB_90 PMDB_94


* TASK-2b: 1994 - 1998 (Baseline party = PMDB)
sureg ///
          (PT_ln98 PT_ln94 DEM_ln94 PSDB_ln94 PP_ln94 Other_ln94) ///
		  (DEM_ln98 PT_ln94 DEM_ln94 PSDB_ln94 PP_ln94 Other_ln94) ///
		  (PSDB_ln98 PT_ln94 DEM_ln94 PSDB_ln94 PP_ln94 Other_ln94) ///
		  (PP_ln98 PT_ln94 DEM_ln94 PSDB_ln94 PP_ln94 Other_ln94) ///
		  (Other_ln98 PT_ln94 DEM_ln94 PSDB_ln94 PP_ln94 Other_ln94) ///
		  [w = VV98], small dfk isure
		  
estsimp sureg ///
          (PT_ln98 PT_ln94 DEM_ln94 PSDB_ln94 PP_ln94 Other_ln94) ///
		  (DEM_ln98 PT_ln94 DEM_ln94 PSDB_ln94 PP_ln94 Other_ln94) ///
		  (PSDB_ln98 PT_ln94 DEM_ln94 PSDB_ln94 PP_ln94 Other_ln94) ///
		  (PP_ln98 PT_ln94 DEM_ln94 PSDB_ln94 PP_ln94 Other_ln94) ///
		  (Other_ln98 PT_ln94 DEM_ln94 PSDB_ln94 PP_ln94 Other_ln94) ///
		  [w = VV98], small dfk isure sims(1000) antisim
		  
setx mean [w=VV98]

simqi, pv genpv(pv_pt_ln98 pv_dem_ln98 pv_psdb_ln98 pv_pp_ln98 pv_other_ln98) tfunc(logiti)
simqi, ev genev(ev_pt_ln98 ev_dem_ln98 ev_psdb_ln98 ev_pp_ln98 ev_other_ln98) tfunc(logiti)

generate pv_pmdb_ln98 = 1 - (pv_pt_ln98 + pv_dem_ln98 + pv_psdb_ln98 + pv_pp_ln98 + pv_other_ln98)
generate ev_pmdb_ln98 = 1 - (ev_pt_ln98 + ev_dem_ln98 + ev_psdb_ln98 + ev_pp_ln98 + ev_other_ln98)

summarize pv_pmdb_ln98 ev_pmdb_ln98
summarize PT_94 PT_98 DEM_94 DEM_98 PSDB_94 PSDB_98 PP_94 PP_98 PMDB_94 PMDB_98


* TASK-2c: 1998 - 2002 (Baseline party = PMDB)
sureg ///
          (PT_ln02 PT_ln98 DEM_ln98 PSDB_ln98 PP_ln98 Other_ln98) ///
		  (DEM_ln02 PT_ln98 DEM_ln98 PSDB_ln98 PP_ln98 Other_ln98) ///
		  (PSDB_ln02 PT_ln98 DEM_ln98 PSDB_ln98 PP_ln98 Other_ln98) ///
		  (PP_ln02 PT_ln98 DEM_ln98 PSDB_ln98 PP_ln98 Other_ln98) ///
		  (Other_ln02 PT_ln98 DEM_ln98 PSDB_ln98 PP_ln98 Other_ln98) ///
		  [w = VV02], small dfk isure
		  
estsimp sureg ///
          (PT_ln02 PT_ln98 DEM_ln98 PSDB_ln98 PP_ln98 Other_ln98) ///
		  (DEM_ln02 PT_ln98 DEM_ln98 PSDB_ln98 PP_ln98 Other_ln98) ///
		  (PSDB_ln02 PT_ln98 DEM_ln98 PSDB_ln98 PP_ln98 Other_ln98) ///
		  (PP_ln02 PT_ln98 DEM_ln98 PSDB_ln98 PP_ln98 Other_ln98) ///
		  (Other_ln02 PT_ln98 DEM_ln98 PSDB_ln98 PP_ln98 Other_ln98) ///
		  [w = VV02], small dfk isure sims(1000) antisim
		  
setx mean [w=VV02]

simqi, pv genpv(pv_pt_ln02 pv_dem_ln02 pv_psdb_ln02 pv_pp_ln02 pv_other_ln02) tfunc(logiti)
simqi, ev genev(ev_pt_ln02 ev_dem_ln02 ev_psdb_ln02 ev_pp_ln02 ev_other_ln02) tfunc(logiti)

generate pv_pmdb_ln02 = 1 - (pv_pt_ln02 + pv_dem_ln02 + pv_psdb_ln02 + pv_pp_ln02 + pv_other_ln02)
generate ev_pmdb_ln02 = 1 - (ev_pt_ln02 + ev_dem_ln02 + ev_psdb_ln02 + ev_pp_ln02 + ev_other_ln02)

summarize pv_pmdb_ln02 ev_pmdb_ln02
summarize PT_98 PT_02 DEM_98 DEM_02 PSDB_98 PSDB_02 PP_98 PP_02 PMDB_98 PMDB_02


* TASK-2d: 2002 - 2006 (Baseline party = PMDB)
sureg ///
          (PT_ln06 PT_ln02 DEM_ln02 PSDB_ln02 PP_ln02 Other_ln02) ///
		  (DEM_ln06 PT_ln02 DEM_ln02 PSDB_ln02 PP_ln02 Other_ln02) ///
		  (PSDB_ln06 PT_ln02 DEM_ln02 PSDB_ln02 PP_ln02 Other_ln02) ///
		  (PP_ln06 PT_ln02 DEM_ln02 PSDB_ln02 PP_ln02 Other_ln02) ///
		  (Other_ln06 PT_ln02 DEM_ln02 PSDB_ln02 PP_ln02 Other_ln02) ///
		  [w = VV06], small dfk isure
		  
estsimp sureg ///
          (PT_ln06 PT_ln02 DEM_ln02 PSDB_ln02 PP_ln02 Other_ln02) ///
		  (DEM_ln06 PT_ln02 DEM_ln02 PSDB_ln02 PP_ln02 Other_ln02) ///
		  (PSDB_ln06 PT_ln02 DEM_ln02 PSDB_ln02 PP_ln02 Other_ln02) ///
		  (PP_ln06 PT_ln02 DEM_ln02 PSDB_ln02 PP_ln02 Other_ln02) ///
		  (Other_ln06 PT_ln02 DEM_ln02 PSDB_ln02 PP_ln02 Other_ln02) ///
		  [w = VV06], small dfk isure sims(1000) antisim
		  
setx mean [w=VV06]

simqi, pv genpv(pv_pt_ln06 pv_dem_ln06 pv_psdb_ln06 pv_pp_ln06 pv_other_ln06) tfunc(logiti)
simqi, ev genev(ev_pt_ln06 ev_dem_ln06 ev_psdb_ln06 ev_pp_ln06 ev_other_ln06) tfunc(logiti)

generate pv_pmdb_ln06 = 1 - (pv_pt_ln06 + pv_dem_ln06 + pv_psdb_ln06 + pv_pp_ln06 + pv_other_ln06)
generate ev_pmdb_ln06 = 1 - (ev_pt_ln06 + ev_dem_ln06 + ev_psdb_ln06 + ev_pp_ln06 + ev_other_ln06)

summarize pv_pmdb_ln06 ev_pmdb_ln06
summarize PT_02 PT_06 DEM_02 DEM_06 PSDB_02 PSDB_06 PP_02 PP_06 PMDB_02 PMDB_06


* TASK-2e: 2006 - 2010 (Baseline party = PMDB)
sureg ///
          (PT_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  (DEM_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  (PSDB_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  (PP_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  (PR_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  (Other_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  [w = VV10], small dfk isure
		  
estsimp sureg ///
          (PT_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  (DEM_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  (PSDB_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  (PP_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  (PR_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  (Other_ln10 PT_ln06 DEM_ln06 PSDB_ln06 PP_ln06 Other_ln06) ///
		  [w = VV10], small dfk isure sims(1000) antisim
		  
setx mean [w=VV10]

simqi, pv genpv(pv_pt_ln10 pv_dem_ln10 pv_psdb_ln10 pv_pp_ln10 pv_pr_ln10 pv_other_ln10) tfunc(logiti)
simqi, ev genev(ev_pt_ln10 ev_dem_ln10 ev_psdb_ln10 ev_pp_ln10 ev_pr_ln10 ev_other_ln10) tfunc(logiti)

generate pv_pmdb_ln10 = 1 - (pv_pt_ln10 + pv_dem_ln10 + pv_psdb_ln10 + pv_pp_ln10 + pv_pr_ln10 + pv_other_ln10)
generate ev_pmdb_ln10 = 1 - (ev_pt_ln10 + ev_dem_ln10 + ev_psdb_ln10 + ev_pp_ln10 + ev_pr_ln10 + ev_other_ln10)

summarize pv_pmdb_ln10 ev_pmdb_ln10
summarize PT_06 PT_10 DEM_06 DEM_10 PSDB_06 PSDB_10 PP_06 PP_10 PMDB_06 PMDB_10  PR_10

* TASK-2f: 2010 - 2014 (Baseline party = PMDB)
sureg ///
          (PT_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  (DEM_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  (PSDB_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  (PP_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  (PR_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  (Other_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  [w = VV14], small dfk isure
		  
estsimp sureg ///
          (PT_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  (DEM_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  (PSDB_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  (PP_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  (PR_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  (Other_ln14 PT_ln10 DEM_ln10 PSDB_ln10 PP_ln10 PR_ln10 Other_ln10) ///
		  [w = VV14], small dfk isure sims(1000) antisim
		  
setx mean [w=VV14]

simqi, pv genpv(pv_pt_ln14 pv_dem_ln14 pv_psdb_ln14 pv_pp_ln14 pv_pr_ln14 pv_other_ln14) tfunc(logiti)
simqi, ev genev(ev_pt_ln14 ev_dem_ln14 ev_psdb_ln14 ev_pp_ln14 ev_pr_ln14 ev_other_ln14) tfunc(logiti)

generate pv_pmdb_ln14 = 1 - (pv_pt_ln14 + pv_dem_ln14 + pv_psdb_ln14 + pv_pp_ln14 + pv_pr_ln14 + pv_other_ln14)
generate ev_pmdb_ln14 = 1 - (ev_pt_ln14 + ev_dem_ln14 + ev_psdb_ln14 + ev_pp_ln14 + ev_pr_ln14 + ev_other_ln14)

summarize pv_pmdb_ln14 ev_pmdb_ln14
summarize PT_10 PT_14 DEM_10 DEM_14 PSDB_10 PSDB_14 PP_10 PP_14 PMDB_10 PMDB_14  PR_10 PR_14



********************************************************************************
* TASK-3: Estimate relative nationalisation - Ecuador
* TASK-3a: 1979 - 1984
* TASK-3b: 1984 - 1988
* TASK-3c: 1988 - 1990
* TASK-3d: 1990 - 1992
* TASK-3e: 1992 - 1996
* TASK-3f: 1996 - 1998
* TASK-3g: 1998 - 2006
* TASK-3h: 2006 - 2009
* TASK-3i: 2009 - 2013
********************************************************************************

* TASK-3a: 1979 - 1984 (Baseline party = Other)
sureg /// 
          (CFP_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  (DP_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  (PID_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  (PMPD_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  (PRE_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  (PSC_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  [w = VV84], small dfk isure
		  
estsimp sureg /// 
          (CFP_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  (DP_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  (PID_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  (PMPD_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  (PRE_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  (PSC_ln84 CFP_ln79 PCE_ln79 PID_ln79 PMPD_ln79 PSC_ln79) ///
		  [w = VV84], small dfk isure sims(1000) antisim
		  
setx mean [w=VV84] 

simqi, pv genpv(pv_cfp_ln84 pv_dp_ln84 pv_pid_ln84 pv_pmpd_ln84 pv_pre_ln84 pv_psc_ln84) tfunc(logiti) 
simqi, ev genev(ev_cfp_ln84 ev_dp_ln84 ev_pid_ln84 ev_pmpd_ln84 ev_pre_ln84 ev_psc_ln84) tfunc(logiti) 

summarize CFP_79 CFP_84 PID_79 PID_84 PMPD_79 PMPD_84 PSC_79 PSC_84

* TASK-3b: 1984 - 1988 (Baseline party = Other)
sureg /// 
          (CFP_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  (DP_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  (PCE_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  (PID_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  (PRE_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  (PSC_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  [w = VV88], small dfk isure
		  
estsimp sureg /// 
          (CFP_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  (DP_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  (PCE_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  (PID_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  (PRE_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  (PSC_ln88 CFP_ln84 DP_ln84 PRE_ln84 PID_ln84 PMPD_ln84 PSC_ln84) ///
		  [w = VV88], small dfk isure sims(1000) antisim
		  
setx mean [w=VV88] 

simqi, pv genpv(pv_cfp_ln88 pv_dp_ln88 pv_pid_ln88 pv_pce_ln88 pv_pre_ln88 pv_psc_ln88) tfunc(logiti) 
simqi, ev genev(ev_cfp_ln88 ev_dp_ln88 ev_pid_ln88 ev_pce_ln88 ev_pre_ln88 ev_psc_ln88) tfunc(logiti) 

summarize CFP_84 CFP_88 DP_84 DP_88 PID_84 PID_88 PRE_84 PRE_88 PSC_84 PSC_88

* TASK-3c: 1988 - 1990 (Baseline party = Other)
sureg /// 
          (PCE_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (DP_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (PID_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (PMPD_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (PRE_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (PSC_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (PSE_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  [w = VV90], small dfk isure
		  
estsimp sureg /// 
          (PCE_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (DP_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (PID_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (PMPD_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (PRE_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (PSC_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  (PSE_ln90 CFP_ln88 DP_ln88 PCE_ln88 PID_ln88 PRE_ln88 PSC_ln88) ///
		  [w = VV90], small dfk isure sims(1000) antisim
		  
setx mean [w=VV90] 

simqi, pv genpv(pv_pce_ln90 pv_dp_ln90 pv_pid_ln90 pv_pmpd_ln90 pv_pre_ln90 pv_psc_ln90 pv_pse_ln90) tfunc(logiti) 
simqi, ev genev(ev_pce_ln90 ev_dp_ln90 ev_pid_ln90 ev_pmpd_ln90 ev_pre_ln90 ev_psc_ln90 ev_pse_ln90) tfunc(logiti) 

summarize DP_88 DP_90 PID_88 PID_90 PRE_88 PRE_90 PSC_88 PSC_90

* TASK-3d: 1990 - 1992 (Baseline party = Other)
sureg /// 
          (DP_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PCE_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PID_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PMPD_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PRE_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PSC_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PSE_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  [w = VV92], small dfk isure
		  
estsimp sureg /// 
          (DP_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PCE_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PID_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PMPD_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PRE_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PSC_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  (PSE_ln92 PCE_ln90 DP_ln90 PID_ln90 PMPD_ln90 PRE_ln90 PSC_ln90 PSE_ln90) ///
		  [w = VV92], small dfk isure sims(1000) antisim
		  
setx mean [w=VV92] 

simqi, pv genpv(pv_dp_ln92 pv_pce_ln92 pv_pid_ln92 pv_pmpd_ln92 pv_pre_ln92 pv_psc_ln92 pv_pse_ln92) tfunc(logiti) 
simqi, ev genev(ev_dp_ln92 ev_pce_ln92 ev_pid_ln92 ev_pmpd_ln92 ev_pre_ln92 ev_psc_ln92 ev_pse_ln92) tfunc(logiti) 

summarize DP_90 DP_92 PCE_90 PCE_92 PID_90 PID_92 PRE_90 PRE_92 PMPD_90 PMPD_92 PSC_90 PSC_92 PSE_90 PSE_92

* TASK-3e: 1992 - 1996 (Baseline party = Other)
sureg /// 
          (DP_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  (MUPPNP_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  (PID_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  (PMPD_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  (PRE_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  (PSC_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  [w = VV96], small dfk isure
		  
estsimp sureg /// 
          (DP_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  (MUPPNP_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  (PID_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  (PMPD_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  (PRE_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  (PSC_ln96 DP_ln92 PCE_ln92 PID_ln92 PMPD_ln92 PRE_ln92 PSC_ln92 PSE_ln92) ///
		  [w = VV96], small dfk isure sims(1000) antisim
		  
setx mean [w=VV96] 

simqi, pv genpv(pv_dp_ln96 pv_muppnp_ln96 pv_pid_ln96 pv_pmpd_ln96 pv_pre_ln96 pv_psc_ln96) tfunc(logiti) 
simqi, ev genev(ev_dp_ln96 ev_muppnp_ln96 ev_pid_ln96 ev_pmpd_ln96 ev_pre_ln96 ev_psc_ln96) tfunc(logiti) 

summarize DP_92 DP_96 PID_92 PID_96 PRE_92 PRE_96 PMPD_92 PMPD_96 PSC_92 PSC_96

* TASK-3f: 1996 - 1998 (Baseline party = Other)
sureg /// 
          (DP_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (MCNP_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (PCE_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (PID_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (PMPD_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (PRE_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (PSC_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  [w = VV98], small dfk isure
		  
estsimp sureg /// 
          (DP_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (MCNP_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (PCE_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (PID_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (PMPD_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (PRE_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  (PSC_ln98 DP_ln96 MUPPNP_ln96 PID_ln96 PMPD_ln96 PRE_ln96 PSC_ln96) ///
		  [w = VV98], small dfk isure sims(1000) antisim
		  
setx mean [w=VV98] 

simqi, pv genpv(pv_dp_ln98 pv_mcnp_ln98 pv_pce_ln98 pv_pid_ln98 pv_pmpd_ln98 pv_pre_ln98 pv_psc_ln98) tfunc(logiti) 
simqi, ev genev(ev_dp_ln98 ev_mcnp_ln98 ev_pce_ln98 ev_pid_ln98 ev_pmpd_ln98 ev_pre_ln98 ev_psc_ln98) tfunc(logiti) 

summarize DP_96 DP_98 PID_96 PID_98 PRE_96 PRE_98 PMPD_96 PMPD_98 PSC_96 PSC_98

* TASK-3g: 1998 - 2006 (Baseline party = Other)
sureg /// 
          (CFP_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (MCNP_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (MUPPNP_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (PID_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (PMPD_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (PRIAN_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (PRE_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (PSC_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  [w = VV06], small dfk isure
		  
estsimp sureg /// 
          (CFP_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (MCNP_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (MUPPNP_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (PID_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (PMPD_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (PRIAN_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (PRE_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  (PSC_ln06 DP_ln98 MCNP_ln98 PCE_ln98 PID_ln98 PMPD_ln98 PRE_ln98 PSC_ln98) ///
		  [w = VV06], small dfk isure sims(1000) antisim
		  
setx mean [w=VV06] 

simqi, pv genpv(pv_cfp_ln06 pv_mcnp_ln06 pv_muppnp_ln06 pv_pid_ln06 pv_pmpd_ln06 pv_prian_ln06 pv_pre_ln06 pv_psc_ln06) tfunc(logiti) 
simqi, ev genev(ev_cfp_ln06 ev_mcnp_ln06 ev_muppnp_ln06 ev_pid_ln06 ev_pmpd_ln06 ev_prian_ln06 ev_pre_ln06 ev_psc_ln06) tfunc(logiti) 

summarize MCNP_98 MCNP_06 PID_98 PID_06 PMPD_98 PMPD_06 PRE_98 PRE_06 PSC_98 PSC_06

* TASK-3h: 2006 - 2009 (Baseline party = Other)
sureg /// 
          (PAIS_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (MUPPNP_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PID_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PMPD_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PRIAN_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PRE_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PSC_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PSP_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  [w = VV09], small dfk isure
		  
estsimp sureg /// 
          (PAIS_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (MUPPNP_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PID_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PMPD_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PRIAN_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PRE_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PSC_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  (PSP_ln09 CFP_ln06 MCNP_ln06 MUPPNP_ln06 PID_ln06 PMPD_ln06 PRIAN_ln06 PRE_ln06 PSC_ln06) ///
		  [w = VV09], small dfk isure sims(1000) antisim
		  
setx mean [w=VV09] 

simqi, pv genpv(pv_pais_ln09 pv_muppnp_ln09 pv_pid_ln09 pv_pmpd_ln09 pv_prian_ln09 pv_pre_ln09 pv_psc_ln09 pv_psp_ln09) tfunc(logiti) 
simqi, ev genev(ev_pais_ln09 ev_muppnp_ln09 ev_pid_ln09 ev_pmpd_ln09 ev_prian_ln09 ev_pre_ln09 ev_psc_ln09 ev_psp_ln09) tfunc(logiti) 

summarize MUPPNP_06 MUPPNP_09 PID_06 PID_09 PMPD_06 PMPD_09 PRIAN_06 PRIAN_09 PRE_06 PRE_09 PSC_06 PSC_09

* TASK-3i: 2009 - 2013 (Baseline party = Other)
sureg /// 
          (PAIS_ln13 PAIS_ln09 MUPPNP_ln09 PID_ln09 PMPD_ln09 PRIAN_ln09 PRE_ln09 PSC_ln09 PSP_ln09) ///
		  (PRIAN_ln13 PAIS_ln09 MUPPNP_ln09 PID_ln09 PMPD_ln09 PRIAN_ln09 PRE_ln09 PSC_ln09 PSP_ln09) ///
		  (PRE_ln13 PAIS_ln09 MUPPNP_ln09 PID_ln09 PMPD_ln09 PRIAN_ln09 PRE_ln09 PSC_ln09 PSP_ln09) ///
		  (PSC_ln13 PAIS_ln09 MUPPNP_ln09 PID_ln09 PMPD_ln09 PRIAN_ln09 PRE_ln09 PSC_ln09 PSP_ln09) ///
		  (PSP_ln13 PAIS_ln09 MUPPNP_ln09 PID_ln09 PMPD_ln09 PRIAN_ln09 PRE_ln09 PSC_ln09 PSP_ln09) ///
		  [w = VV13], small dfk isure
		  
estsimp sureg /// 
          (PAIS_ln13 PAIS_ln09 MUPPNP_ln09 PID_ln09 PMPD_ln09 PRIAN_ln09 PRE_ln09 PSC_ln09 PSP_ln09) ///
		  (PRIAN_ln13 PAIS_ln09 MUPPNP_ln09 PID_ln09 PMPD_ln09 PRIAN_ln09 PRE_ln09 PSC_ln09 PSP_ln09) ///
		  (PRE_ln13 PAIS_ln09 MUPPNP_ln09 PID_ln09 PMPD_ln09 PRIAN_ln09 PRE_ln09 PSC_ln09 PSP_ln09) ///
		  (PSC_ln13 PAIS_ln09 MUPPNP_ln09 PID_ln09 PMPD_ln09 PRIAN_ln09 PRE_ln09 PSC_ln09 PSP_ln09) ///
		  (PSP_ln13 PAIS_ln09 MUPPNP_ln09 PID_ln09 PMPD_ln09 PRIAN_ln09 PRE_ln09 PSC_ln09 PSP_ln09) ///
		  [w = VV13], small dfk isure sims(1000) antisim
		  
setx mean [w=VV13] 

simqi, pv genpv(pv_pais_ln13 pv_prian_ln13 pv_pre_ln13 pv_psc_ln13 pv_psp_ln13) tfunc(logiti) 
simqi, ev genev(ev_pais_ln13 ev_prian_ln13 ev_pre_ln13 ev_psc_ln13 ev_psp_ln13) tfunc(logiti) 

summarize PAIS_09 PAIS_13 PRIAN_09 PRIAN_13 PRE_09 PRE_13 PSC_09 PSC_13 PSP_09 PSP_13

